home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / errmon.zip / ERRMON.DOC < prev    next >
Text File  |  1985-08-30  |  12KB  |  297 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                   ERRMON 1.1
  8.  
  9.                               By Robert J. Newton
  10.  
  11.        After experiencing a variety of problems with the hard disk on
  12.        my AT, I decided that I wanted a more informative report of disk
  13.        I/O errors than that provided by DOS.  ERRMON is the result and
  14.        it did give me advance warning of total collapse of the infamous
  15.        CMI drive.
  16.  
  17.        ERRMON is a resident program which inserts itself in the INT 13
  18.        chain.  It then sits quietly watching for any error condition
  19.        returned by the disk driver.  When an error is detected, it
  20.        springs to life and prints an error message on the screen.  This
  21.        message is usually more informative than that provided by DOS. 
  22.        The failing command and location of the offending area of the
  23.        disk will also be displayed.  This information will appear as:
  24.  
  25.                        error message xxDxxCxxxxHxxSxxNxx
  26.  
  27.        where the first two digits are the command sent to the bios
  28.        driver and D, C, H and S are the Drive and the starting Cylinder,
  29.        Head and Sector of the INT 13 request and N is the number of
  30.        sectors requested.  The values are in hex; floppy drives will be
  31.        numbered 00, 01; hard drives will be numbered 80, 81.  Note that
  32.        if a multi-sector request was made (N>1) then the values for C, H
  33.        and S will indicate the starting sector, not the actual sector
  34.        causing the error.  The actual location of the error could be
  35.        found only by reading the controller registers, a very hardware
  36.        specific operation.  Also note that some of this information may
  37.        be meaningless for certain INT 13 operations.  After reporting,
  38.        ERRMON gracefully returns to the caller to let it do what it
  39.        wishes with the error.
  40.  
  41.        ERRMON will let you know when DOS makes a first retry.  However,
  42.        ERRMON does not scroll the screen.  This means that it is
  43.        possible that a second message will overlay the first and you
  44.        would not be aware of repeated retries.
  45.  
  46.        A word of caution.  ERRMON has been written to respond to the
  47.        error codes returned by the IBM BIOS disk drivers on the PC, XT
  48.        and AT as shown in the various BIOS listings.  Results with
  49.        other drivers are totally unknown although it might be assumed
  50.        that they map their error codes the same in order to achieve
  51.        compatibility.  There are no checks for machine or drive type.
  52.  
  53.        In addition, the errors defined for the PC/XT and AT fixed disk
  54.        drivers are not the same in all cases.  ERRMON responds to the
  55.        codes for both.  It is possible, but not likely, that say the AT
  56.        could through some glitch return an error code that is not
  57.        defined on the AT, but is on the XT.  Instead of displaying an
  58.        "Undefined error" message, ERRMON would display the message
  59.  
  60.                                        1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.        defined for the XT.  This possibility was considered so remote
  67.        that it was not trapped.
  68.  
  69.        The only error that ERRMON does not respond to is applicable
  70.        only to the AT.  Its floppy disk driver may report an error that
  71.        is related to the dual nature of the AT's high capacity drives. 
  72.        This is not a true i/o error and is ignored by ERRMON.
  73.  
  74.        Many copy protected programs will cause ERRMON to display an
  75.        error message but the program will run normally.  The program is
  76.        deliberately causing the error as a part of its check for an
  77.        original distribution disk.  Other programs such as FORMAT,
  78.        DISKCOPY and DISKCOMP may report errors as a part of their
  79.        determining the type of disk with which they are dealing.
  80.  
  81.        It has been reported that certain Teac drives used with certain
  82.        drivers will return one or two error reports on any read attempt
  83.        of a drive that is not already spinning.  This is believed to be
  84.        due to the mechanical design of the Teac drive.  To quote from
  85.        the IBM BIOS listings, "On read accesses, no motor start delay is
  86.        taken, so that three retries are required on reads to ensure that
  87.        the problem is not due to motor start-up".  This means that DOS
  88.        must make at least one retry on every read access of these drives
  89.        unless the driver software has been written to make the retries,
  90.        a fact that has been hidden from you.  It has also been reported
  91.        that the design of these drives causes them to have problems with
  92.        some copy protection schemes.
  93.  
  94.        ERRMON's overhead is essentially nil, five instructions when
  95.        there is no error.  Approximately 1K of memory will be used,
  96.        depending on how much environment space is in use when it
  97.        is loaded.
  98.  
  99.        The video attribute for the error messages has been set to 0F,
  100.        intense white.  The messages will print in the lower right
  101.        corner of the screen.  You may change both of these by using
  102.        DEBUG.  The attribute byte is at offset 0332 and the screen line
  103.        is at offset 02E3.  Note that the screen line is relative to 0
  104.        so that the last line is hex 18, decimal 24.  For those with
  105.        MASM, you may change the EQUATEs at the beginning.  You may also
  106.        change the message text.  If you change the message text such
  107.        that the entire line would exceed the presently set width ERRMON
  108.        will truncate the line to the screen width.
  109.  
  110.        Installation is simple, just type errmon.  A successful
  111.        installation will return ERRORLEVEL 0, unsuccessful will return
  112.        255.  It can be installed by an AUTOEXEC.BAT, preferably before
  113.        anything else which might place itself in the INT 13 chain so
  114.        that it receives the register values returned by the disk device
  115.        driver.  You can use >nul to avoid the sign on message.
  116.  
  117.  
  118.  
  119.                                        2
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                 Error messages
  127.  
  128.        Note that some of these errors are applicable to both floppy and
  129.        hard disks; others are applicable only to hard disks.  These
  130.        descriptions are by no means complete.
  131.  
  132.        Sense failure (PC/XT only)
  133.  
  134.        Status error (AT only) - The controller status register returned
  135.        an error condition, but the error register did not contain an
  136.        error code.
  137.  
  138.        Write fault (AT only) - Indicates a hardware problem with the
  139.        drive. 
  140.  
  141.        Undefined error - An error code was returned for which BIOS has
  142.        not defined an error.
  143.  
  144.        Drive not ready (AT only)
  145.  
  146.        No response - The time alloted for an operation expired without
  147.        a response from the drive, what DOS calls Drive not ready.
  148.  
  149.        Seek failure - An attempt to seek to the requested cylinder was
  150.        unsuccessful.  Assuming the cylinder number was valid for the
  151.        disk, this probably indicates a hardware problem.
  152.  
  153.        Controller failure - Probably indicates that the controller could
  154.        not successfully complete the requested command within the
  155.        alloted time.
  156.  
  157.        EEC corrected error - An information report that the controller's
  158.        EEC algorithm successfully corrected a soft data error.  You
  159.        should copy the file and delete the original if this happens
  160.        frequently to a file.
  161.  
  162.        Bad CRC/EEC on read - The sector could not be successfully read. 
  163.        This is the most common of all disk I/O errors, probably
  164.        outnumbering all others combined, and can have many causes:
  165.        defective media, dirty heads, misaligned drives, electrical
  166.        glitches ...  The controller itself may make several attempts to
  167.        read the sector before giving up with an error report and DOS
  168.        will make five retries before it gives up and finally (usually,
  169.        but not always) lets you know that a problem exists.  You may
  170.        still be able to recover the sector by answering the prompt with
  171.        R for retry a few times.  If you can read the sector, the file
  172.